-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP refact(table): decouple buffer from table-view by moving paging up to model #70
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ Python's ints have arbitrary digits, are not just 32bit.
+ The `buffer.start` offset was added by models/timeseries to describe coordinates against the full table; buffer internally was substracting it back. + Change reduces a bit coupling to internals of buffer (Demeter law).
+ Reading a full chunk (1000 rows) from a compressed HDF5 file would be a waste of CPU. + Also decouple readability-check from chunk-size/start value
+ Speedup model by avoiding useless data-loading.
@uvemas I would also like to consolidate classes a bit in fewer modules:
It does make sense, for instance, when a logger writes a message, you probably care if it is a view or model, but not if it is a scrollbar or a delegate. Python tradition diverts from java's one class, one file to keep things terse. Would that be ok? |
+ Move start/nrows/chunk_size attributes up, from buffer-->model. + Drop or move buffer-fields, to decouple it from model & view (ie. to facilitate replacing it with a DataFrame). + Move & merge buffer.getReadParameters()-->model.loadData(). + DROP `model.chunk_size`, it is identical to `nrows`. - Indexing errors in `buffer.getCell()` don't report `start` anymore :-(
+ Centralize error-reporting for cell indexing-errors. + Logging: + Restore start offset-logging on cell indexing errors. + Class-logger-->module-var, not to waste loggers with each new object. + Stop specifying log-levels (must be done to all loggers).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I want to add a new feature that will display pandas dataframes(see #35), but I had problems factoring out a clean table model that exposes the dataframe cells. In the process I realized that the table
vitables.vttables
classesLeafView/LeafModel/Buffer
were highly coupled, without clear responsibilities.This PR restructures model & buffer according to these guidelines:
start/nrows/chunk_size
attributes up, from buffer-->model.model.chunk_size
withnrows
in model - they served the same purposebuffer.getReadParameters()
-->model.loadData()
.np.int64
for long tables - python ints are just as fine.data_set
-->leaf
).WIP:
(when it is finished, the
'WIP'
has to be removed from this PR's title.)